import java.util.Arrays;
import java.util.Scanner;

//定义一个类,注意此时Student是放在Test类外面的
class Student {

    //定义成员属性
    public String name;
    public short age;
    public double score;

    //写一个构造方法
    public Student() {
        this.name = "zhangsan";
        this.age = 18;
        this.score = 95.0;
        System.out.println("这是没有参数的构造方法");
        System.out.println(name +" " + age +" "+ score);
    }

    //定义成员方法
    public void Exam() {
        System.out.println(name + " 考试！");
    }
}

public class Test {
    //例题
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            while (scanner.hasNextInt()) {
                int x = scanner.nextInt();
                int y = scanner.nextInt();
                Data data = new Data(x, y);
                System.out.println(data.getX() + data.getY());
            }
        }

    }
    class Data {
        public int x;
        public int y;
        public Data(int x, int y) {
            this.x = x;
            this.y = y;
        }
        public int getX() {
            return x;
        }
        public int getY() {
            return y;
        }




    //引用 指向引用的例子，这个说法是不对的，是指向了另外一个引用指向的对象
    public static void main5(String[] args) {
        Student student1 = new Student();
        Student student2 = new Student();
        //student1 = student2 ;
    }

    public static void main2(String[] args) {
        Student student = new Student();
        student.name = "张三";
        student.Exam();
    }

    //创建一个二维数组
    public static void main1(String[] args) {
        int[][] array = {{1,2,3},{1,2}};
        int[][] array1 = new int[3][];
        int[][] array2 = new int[][] {{1},{2}};
        System.out.println(Arrays.deepToString(array2));
    }
}
